package com.example.car.model

import com.example.car.api.CarApiService
import com.example.net.RetrofitUtils
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import retrofit2.Retrofit
import javax.inject.Qualifier
import javax.inject.Singleton

@Qualifier
@Retention(AnnotationRetention.BINARY)
annotation class Car{

}
@Module
@InstallIn(SingletonComponent::class)
object CarWorkModel {
    @Car
    @Provides
    @Singleton
    fun provideRetrofit():Retrofit{
        return RetrofitUtils.getRetrofit()
    }
    @Provides
    @Singleton
    fun provideCarService(@Car retrofit:Retrofit): CarApiService {
        return retrofit.create(CarApiService::class.java)
    }
}